//
//  ViewController.swift
//  SetUIViewBGImage
//
//  Created by 朱路路 on 2017/11/11.
//  Copyright © 2017年 huangteng. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        //1.通过UIImageView设置
//        self.view.insertSubview(UIImageView.init(image: UIImage.init(named: "123")), at: 0)
        
        //2.通过layer的content
        self.view.layer.contents = UIImage.init(named: "123")?.cgImage
        self.view.contentMode = UIViewContentMode.scaleToFill
        
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

